/***********************************************************************
	filename: 	DaterTransEvent.h
	created:	15/4/2012
	author:		4Ys
	
	purpose:	Defines classes of translator from client to server, specifically for event.	            
*************************************************************************/
#ifndef _DaterTransEvent_h_
#define _DaterTransEvent_h_

#include "DaterTranslator.h"
#include "DaterSingleton.h"

namespace Dater
{
	class TransEvent : public Translator
	{
	public:
		/*!
		 \brief
			 Construct class TransEvent with a param.

		 \param order
		     - a char* of order from client to server to describe the event.
		*/
		TransEvent():Translator() {}

		/*!
		 \brief
			 A pure virtual function generates from class Translator, specifically for event.

		 \return
			 a string of order, especially for event.
		*/
		virtual bool execute(int& clientUid, std::vector<std::string>& sendMessages, std::vector<int>& sendClientUids) = 0;

		virtual bool judge( const char* order );
	};

	class TransEventAdd : public TransEvent, public Singleton<TransEventAdd>
	{
	public:
		/*!
		 \brief
			 Construct class TransEventAdd with a param.

		 \param order
		     - a char* of order from client to server to add an event.
		*/
		TransEventAdd(): TransEvent(){_ifRequest = false;}

		/*!
		 \brief
			 A virtual function generates from class Translator, specifically for adding event.

		 \param order
		     - a char* of order from client to server.

		 \return
			 a string of order, especially for event.
		*/
		virtual bool execute(int& clientUid, std::vector<std::string>& sendMessages, std::vector<int>& sendClientUids);

		virtual bool judge( const char* order );
	};

	class TransEventDelete : public TransEvent, public Singleton<TransEventDelete>
	{
	public:
		/*!
		 \brief
			 Construct class TransEventDelete with a param.

		 \param order
		     - a char* of order from client to server to delete an event.
		*/
		TransEventDelete(): TransEvent(){_ifRequest = false;}

		/*!
		 \brief
			 A virtual function generates from class Translator, specifically for deleting event.

		 \param order
		     - a char* of order from client to server.

		 \return
			 a string of order, especially for event.
		*/
		virtual bool execute(int& clientUid, std::vector<std::string>& sendMessages, std::vector<int>& sendClientUids);

		virtual bool judge( const char* order );
	};

	class TransEventUpdate : public TransEvent, public Singleton<TransEventUpdate>
	{
	public:
		/*!
		 \brief
			 Construct class TransEventUpdate with a param.

		 \param order
		     - a char* of order from client to server to update an event.
		*/
		TransEventUpdate(): TransEvent(){_ifRequest = false;}
		
		/*!
		 \brief
			 A virtual function generates from class Translator, specifically for updating event.

		 \param order
		     - a char* of order from client to server.

		 \return
			 a string of order, especially for event.
		*/
		virtual bool execute(int& clientUid, std::vector<std::string>& sendMessages, std::vector<int>& sendClientUids);

		virtual bool judge( const char* order );
	};

	class TransEventView : public TransEvent, public Singleton<TransEventView>
	{
	public:
		/*!
		 \brief
			 Construct class TransEventView with a param.

		 \param order
		     - a char* of order from client to server to look up an event.
		*/
		TransEventView(): TransEvent(){_ifRequest = false;}

		/*!
		 \brief
			 A virtual function generates from class Translator, specifically for looking up event.

		 \param order
		     - a char* of order from client to server.

		 \return
			 a string of order, especially for event.
		*/
		virtual bool execute(int& clientUid, std::vector<std::string>& sendMessages, std::vector<int>& sendClientUids);

		virtual bool judge( const char* order );
	};
}
#endif